<%--
  Created by IntelliJ IDEA.
  User: SYHT
  Date: 2017/4/10
  Time: 14:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="page" uri="/xianzhiOA/pageTag" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <jsp:include page="documentForeEnd.jsp"/>
    <link href="${pageContext.request.contextPath}/dist/foreEnd/css/bootstrap.css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/dist/foreEnd/css/common.css"/>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/dist/foreEnd/css/jeDate.css" type="text/css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/dist/foreEnd/js/jeDate.js"></script>

    <%--模态框--%>
    <%--<script type="text/javascript" src="${pageContext.request.contextPath}/dist/foreEnd/js/jquery-1.9.1.js"></script>--%>
    <%--<script type="text/javascript" src="${pageContext.request.contextPath}/dist/foreEnd/js/bootstrap.min.3.3.7.js"></script>--%>

    <script type="text/javascript">
        var tis = new tis(300);

        function go(id) {
            tis.confirm("确定要认主了么+_+",function (choose) {
                if(choose){
                    window.location.href = "${pageContext.request.contextPath}/Person/belongTo.do?personId=" + id;
                }
            });
        }

        function rAnTa(id) {
            tis.confirm("确定要重新按他？Σ(っ°Д°;)っ",function (choose) {
                if(choose){
                    window.location.href = "${pageContext.request.contextPath}/Person/editComment.do?personId=" + id+"&again=true";
                }
            });
        }
        
        function openModal(id) {
            $("#myModal").modal();
            $("#uploadId").val(id);
        }

        $(function () {
            if('${param.count}'!=''){
                tis.alert("成功导入${param.count}份简历!");
            }
        })

        function enta(id) {
            document.getElementById("searchForm").action="${pageContext.request.contextPath}/Person/editComment.do";
            document.getElementById("hidPersonIdComment").value=id;
            document.getElementById("searchForm").submit();

        }
    </script>
    <style>
        .myTable {
            text-align: center;
        }

        .myTable th {
            text-align: center;
        }

        .myOnc {
            cursor: pointer;
        }
    </style>
</head>
<body>
<header>
        <jsp:include page="headerForeEnd2.jsp"/>
</header>
<div class="container">

    <!--进度条-->

    <a href="${pageContext.request.contextPath}/view/foreEnd/personImport.html" ><span class="dd fa fa-arrow-left fa-2x"></span></a>
    <%--<a href="javascript:void(0)" onclick="goto('next')"><span class="ff fa fa-arrow-right fa-2x"></span></a>--%>
    <!--搜索框-->
    <div class="allsearch col-l-12">
        <form id="searchForm" action="${pageContext.request.contextPath}/Person/selPersonAll.do" method="post">
            <input id="hidPersonIdComment" name="personIdSearch" style="position: absolute">
            <input id="thePage" type="hidden" name="page">
            <input name="isAll" value="all" style="position: absolute">
            <div id="search_box" class="col-md-3 col-xs-6">
                <input type="text" id="search" name="personName" value="${person.personName}" placeholder=" 姓名"
                       autocomplete="off"/></div>

            <div id="search_box2" class="col-md-3 col-xs-6">
                <input type="text" id="search2" name="personTel" value="${person.personTel}" placeholder=" 电话"
                       autocomplete="off"/></div>

            <div id="search_box3" class="col-md-3 col-xs-6">
                <input id="dateinfo" name="begin" style="width: 100%" value="<fmt:formatDate value="${begin}" type="both"
                                            pattern="yyyy-MM-dd HH:mm:dd"/>" placeholder=" 开始时间"/></div>

            <div id="search_box4" class="col-md-3 col-xs-6">
                <input id="dateinfo2" name="end" style="width: 100%" value="<fmt:formatDate value="${end}" type="both"
                                            pattern="yyyy-MM-dd HH:mm:dd"/>" placeholder=" 结束时间"/>
            </div>

            <div id="search_box5" class="col-md-3 col-xs-6">
                <input type="text" id="search5" name="empName" value="${person.empName}" placeholder=" 负责人"
                       autocomplete="off"/>
            </div>

            <div id="search_box6" class="col-md-3 col-xs-6">
                <select name="personRecord" id="search6" style="height: 34px">
                    <option selected="selected" value="">阶段</option>
                    <option <c:if test="${person.personRecord=='1'}"> selected="selected"</c:if> value="1">没来</option>
                    <option <c:if test="${person.personRecord=='2'}"> selected="selected"</c:if> value="2">待定</option>
                    <option <c:if test="${person.personRecord=='3'}"> selected="selected"</c:if> value="3">pass</option>
                    <option <c:if test="${person.personRecord=='4'}"> selected="selected"</c:if> value="4">关闭</option>
                </select>
            </div>

            <div id="search_box7" class="col-md-3 col-xs-6">
                <select name="personAudit" id="search7" style="height: 34px">
                    <option selected="selected" value="">等级</option>
                    <option value="A" <c:if test="${person.personAudit=='A'}">selected="selected"</c:if>>A</option>
                    <option value="B" <c:if test="${person.personAudit=='B'}">selected="selected"</c:if>>B</option>
                    <option value="C" <c:if test="${person.personAudit=='C'}">selected="selected"</c:if>>C</option>
                </select>
            </div>


            <div id="search_box8" class="col-md-3 col-xs-6">
                <select name="personReception" id="search8" style="height: 34px">
                    <option selected="selected" value="">颜值</option>
                    <option <c:if test="${person.personReception=='1'}"> selected="selected" </c:if> value="1">合格</option>
                    <option <c:if test="${person.personReception=='2'}"> selected="selected" </c:if> value="2">不合格</option>
                </select>
            </div>

            <button type="submit" class="search_btn"><span class="fa fa-search" style="color: white"></span></button>
            <div class="clearfix"></div>
        </form>
        <div id="datePlugin"></div>
        <div style="text-align:center;margin:50px 0; font:normal 14px/24px 'MicroSoft YaHei';">
        </div>
        <div class="clearfix"></div>

        <div class="well">

            <table class="table table-hover myTable" id="now">
                <thead>
                <tr>
                    <th class="v">认主</th>
                    <th class="v">颜值</th>
                    <th class="v">详情</th>
                    <th class="v">按他</th>
                    <th class="v">等级</th>
                    <th class="vv">负责人</th>
                    <th class="vv">姓名</th>
                    <th class="v">性别</th>
                    <th class="v">年龄</th>
                    <th class="vvv">面试日期</th>
                    <th class="vv">电话</th>
                    <th class="vvv">应聘职位</th>
                    <th class="v">学历</th>
                    <th class="vv">工作经验</th>
                    <th class="vv">生日</th>
                    <th class="vvv">评价日期</th>
                </tr>
                </thead>

                <tbody>
                <c:forEach var="p" items="${personList}">
                    <tr>
                        <td>
                            <c:choose>
                                <c:when test="${p.empId==null||p.empId==0}">
                                    <a><i class="fa fa-heart-o myOnc" onclick="go(${p.personId})"></i></a>
                                </c:when>
                                <c:otherwise>
                                    <a><i class="fa fa-heart"></i></a>
                                </c:otherwise>
                            </c:choose>
                        </td>
                        <td>
                            <c:choose>
                                <c:when test="${p.personReception==2}">
                                    <a><i class="fa fa-thumbs-o-down"></i></a>
                                </c:when>
                                <c:when test="${p.personReception==1}">
                                    <a><i class="fa fa-thumbs-up"></i></a>
                                </c:when>
                            </c:choose>
                        </td>
                        <td>
                            <c:choose>
                                <c:when test="${p.personResume!=null}">
                                    <a target="_blank"
                                       href="${pageContext.request.contextPath}/resumeUpload/${p.personResume}"><i
                                            class="fa fa-eye"></i></a>
                                </c:when>
                                <c:otherwise>
                                    <a onclick="openModal(${p.personId})" style="cursor: pointer"><i class="fa fa-cloud-upload"></i></a>
                                </c:otherwise>
                            </c:choose>
                        </td>
                        <td>
                            <c:choose>
                                <c:when test="${p.personRecord==2||p.personRecord==1}">
                                    <%--待命状态--%>
                                    <a href="${pageContext.request.contextPath}/Person/editComment.do?personId=${p.personId}"><i
                                            class="fa fa-comment myOnc"></i></a>
                                </c:when>
                                <c:when test="${p.personRecord==3}">
                                    <%--pass状态--%>
                                    <a onclick="rAnTa(${p.personId})"><i class="fa fa-reply myOnc"></i></a>
                                </c:when>
                                <c:when test="${p.personRecord==4}">
                                    <%--通过状态--%>
                                    <a><i class="fa fa-check"></i></a>
                                </c:when>
                            </c:choose>
                        </td>
                        <td>${p.personAudit}</td>
                        <td>${p.empName}</td>
                        <td>${p.personName}</td>
                        <td>${p.personSex}</td>
                        <td>${p.personAge}</td>
                        <td><fmt:formatDate value="${p.interviewTime}" type="both"
                                            pattern="yyyy年MM月dd日 HH:mm:ss"/></td>
                        <td>${p.personTel}</td>
                        <td>${p.personJob}</td>
                        <td>${p.personEducation}</td>
                        <td>${p.personExp}</td>
                        <td>${p.personBirth}</td>
                        <td><fmt:formatDate value="${p.commentTime}" type="both"
                                            pattern="yyyy年MM月dd日 HH:mm:ss"/></td>
                    </tr>
                </c:forEach>


                </tbody>
            </table>
        </div>
        <!--分页符-->
        <div class="person_bottom">
        <ul class="pagination">
            <%--<li><a disabled="disabled" onclick="pToSub()" class="b">&laquo;</a></li>
            <li class="active"><a onclick="pToSub()">1</a></li>
            <li><a class="b">2</a></li>
            <li><a href="#">3</a></li>
            <li><a href="#">4</a></li>
            <li><a href="#">5</a></li>
            <li><a href="#">&raquo;</a></li>--%>
            <page:paging length="10" page="${page}" pages="${pages}"/>
        </ul>
            <a href="${pageContext.request.contextPath}/Person/Census.do"><button class="person_bt">数据统计</button></a>
    </div>
    </div>
</div>
<%--单一简历上传模态框--%>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="margin-top: 200px">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    上传简历
                </h4>
            </div>
            <form id="uploadForm" action="${pageContext.request.contextPath}/Person/importPerson.do" method="post" enctype="multipart/form-data">
                <div class="modal-body">
                    <input type="hidden" id="uploadId" name="personId">
                    <%--来源：
                    <select name="type">
                        <option value="zl">智联</option>
                        <option value="qc">前程</option>
                    </select>--%>
                    <input type="file" name="file" value="">
                </div>
                <div class="modal-footer">
                    <button type="submit" class="button_s">上传</button>
                </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#nav li').hover(function () {
            $('ul', this).slideDown(200);
            $(this).children('a:first').addClass("hov");
        }, function () {
            $('ul', this).slideUp(100);
            $(this).children('a:first').removeClass("hov");
        });
    });
</script>
<script type="text/javascript" src="${pageContext.request.contextPath}/dist/foreEnd/js/reconnecting-websocket.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/dist/foreEnd/js/webSocket.js"></script>
<script type="text/javascript">
    function onMessage(event) {
        if(event.data=='gunCu'||event.data=="toUpdate"){
            location.reload()
        }
    }
    window.onbeforeunload = function () {
        webSocket.close();
    }
    jeDate({
        dateCell:"#dateinfo",
        isinitVal:false,
        isTime:true,
        minDate:"2014-09-19 00:00:00"
    })
    jeDate({
        dateCell:"#dateinfo2",
        isinitVal:false,
        isTime:true,
        minDate:"2014-09-19 00:00:00"
    })
</script>
</body>
</html>

